<?php
/**
 * Created by PhpStorm.
 * User: wanglong
 * Date: 2017/3/29
 * Time: 15:27
 */
namespace app\wechat\controller;
use app\home\controller;
use app\models\Bases;
use think\Config;

class Shares extends Base{
    public function shares(){
        $shares = new Bases('shares');
        $start_time = strtotime(date('Y-m-d'),time());
        $end_time = $start_time + 3600 * 24;
        $result = $shares->selectData("type_id = 2 and recommend_time < $end_time and `order` != 0","","recommend_time desc,`order` asc","");
        $information = new controller\Information();
        $integral    = new controller\Integral();
        $result = $information->everyStock($result);
        $is_deduction_integral = $integral->checkDeductionIntegral();
        $deduct_integral = $information->deductIntegral();
        return view('shares',['result'=>$result,'is_deduction_integral'=>$is_deduction_integral,'integral'=>Config::get('integral.reading'),'deduct_integral'=>$deduct_integral]);
    }
}